{extend name="_public/table_page" /}

{block name="button"}
<div class="weadmin-block" style="overflow: hidden">
    {if auth("$classuri/add")}
    <button class="layui-btn layui-btn-xs" data-modal='{:url("$classuri/add")}' data-title="添加根节点">添加节点</button>
    {/if}
</div>
{/block}

{block name="table"}
<table class="layui-table" lay-even lay-skin="line" lay-size="sm">
    <thead>
    <tr>
        <th>id</th>
        <th>菜单名称</th>
        <th>url</th>
        <th>操作</th>
    </thead>
    <tbody>
    {volist name="list" id="vo"}
    <tr>
        <td>{$vo.id}</td>
        <td>{$vo._pre|default=''}{$vo.title}</td>
        <td>{$vo.url}</td>
        <td>
            <div class="layui-btn-group">
                {if auth("$classuri/add")}
                <button class="layui-btn layui-btn-xs" href="javascript:;" data-title="添加子菜单" data-modal='{:url("$classuri/add",["pid"=>$vo.id])}'>
                    添加子菜单
                </button>
                {/if}
                {if auth("$classuri/edit")}
                <button class="layui-btn layui-btn-xs" href="javascript:;" data-title="编辑菜单" data-modal='{:url("$classuri/edit",["id"=>$vo.id])}'>
                    编辑
                </button>
                {/if}
                {if auth("$classuri/del")}
                <button class="layui-btn layui-btn-xs" href="javascript:;"
                        data-confirm="确定要删除吗！" data-post='{:url("$classuri/del")}' data-param='ids={$vo.son_ids}'>
                    删除
                </button>
                {/if}
            </div>
        </td>
    </tr>
    {/volist}
    </tbody>
</table>
{/block}
